#!/usr/bin/python
# -*- coding: GBK -*-
# 单件模式
# author: Hyx
# date: 2013-03-28
#--------------------------------------------------------------
class A(object):     # A must be new-style class
    def __init__(self):
        print "enter A"
        print "leave A"

    def __new__(cls, *args, **kargs):
        print "in A new()"
        return object.__new__( cls, *args, **kargs );


class B(A):
    def __init__(self):
        print "enter B"
        super(B, self).__init__()
        print "leave B"

b = B()
#a = A()
